Add tool to identify tablets that need compaction#3650
Conversation
|
In general this looks really good. I only had one comment in there. For extra credit I would like for this tool to optionally (based on a parameter) actually kick off the compactions. |
b2efc96 to
8558761
Compare
Add a utility tool that is able to identify tablets that need compaction. This tool is hosted in the project check-tablet-extents and can be built as an executable JAR. Closes #3581
8558761 to
a7686ad
Compare
-Add main method back to allow usage of the tool with java -cp -Update README for usage of tool with accumulo command -Fix dependency issues
-Replace AccumuloClient usage with ServerContext -Test class requires refactoring for ServerContext -Removed create-shade-jar profile to use regular jar
-Use ClientContext instead of ServerContext to allow test suite to create MiniAccumuloCluster for testing -Refactor original checkTablets() to findCompactableTablets() to handle extent tracking -Add new checkTablets() method to handle tool output and parameter based compaction -Update documentation -Update error logging
|
Overall looks pretty good. Made a couple suggestions. |
-This parameter isn't required if accumulo.properties is on classpath
-Debug parameter controls tablet extent logging -Removed redundant dependencies in pom.xml
| return false; | ||
| } | ||
|
|
||
| public static void checkTablets(ClientContext context, String tableName, Text begin, Text end, boolean mergeExtents, boolean compactTablets, boolean debug) |
There was a problem hiding this comment.
Similar not here about making the argument list simpler by passing in the Opts instance.
| * @throws IOException | ||
| * if an error occurs while reading the client properties file | ||
| */ | ||
| static List<Pair<Text,Text>> findCompactableTablets(ClientContext context, String tableName, Text begin, Text end, boolean mergeExtents, boolean debug) |
There was a problem hiding this comment.
We're starting to pass a fair number of arguments to this method now. It would be simpler to just pass in the Opts instance as an argument, and fetch the appropriate information from it.
| * if an error occurs while reading the client properties file | ||
| */ | ||
| @Override | ||
| public void execute(String[] args) throws AccumuloException, TableNotFoundException, IOException, AccumuloSecurityException { |
There was a problem hiding this comment.
I would like to see the functions ordered a bit differently here. I'd like to see them in the following order:
- main
- execute
- checkTablets
- formatArg
This allows for a more natural progression of understanding the logic flow when reading over the code.
Add a utility tool that is able to identify tablets that need compaction. This tool is hosted in the project check-tablet-extents and can be built as an executable JAR.
Closes #3581